<include file='Common:header' />

<!-- /section:basics/navbar.layout -->
<div class="main-container" id="main-container">

    <!-- #section:basics/sidebar -->

    <include file='Common:left' />


    <!-- /section:basics/sidebar -->
    <div class="main-content">
        <div class="main-content-inner">
            <div class="page-content">



                <!--主题-->
                <div class="page-header">
                    <h1>
                        您当前操作
                        <small>
                            <i class="ace-icon fa fa-angle-double-right"></i>
                            修改文章
                        </small>
                    </h1>
                </div>

                <div class="row">
                    <div class="col-xs-12">
                        <form class="form-horizontal" name="columnadd" id="columnadd" method="post" action="{:U('runnews_edit')}">
                            <input type="hidden" name="news_id" value="{$news.n_id}">
                            <div class="form-group">
                                <label class="col-sm-2 control-label no-padding-right" for="form-field-1"> 文章所属主栏目： </label>
                                <div class="col-sm-10">
                                    <select name="news_columnid"  class="col-sm-3 " >
                                        <option value="">请选择所属栏目 </option>
                                        <foreach name="column" item="vo">
                                            <option value="{$vo.c_id}" <if condition="$vo.column_type eq 1">disabled class="bgccc"<else/>class="bgc"</if> <if condition="$vo['c_id'] eq $news['news_columnid']"> selected </if>>{$vo.lefthtml}{$vo.column_name} <if condition="$vo.column_type eq 1">(频道页)</if></option>
                                        </foreach>
                                    </select>
                                </div>
                            </div>
                            <div class="space-4"></div>

                            <div class="form-group">
                                <label class="col-sm-2 control-label no-padding-right" for="form-field-1"> 文章标题：  </label>
                                <div class="col-sm-10">
                                    <input type="text" name="news_name" id="news_name"  value="{$news.news_title}" placeholder="必填：文章标题"  class="col-xs-10 col-sm-6"/>
                                    <span class="help-inline col-xs-12 col-sm-7">
                                        <span class="middle" id="resone"></span>
                                    </span>
                                </div>
                            </div>
                            <div class="space-4"></div>
                            <div class="form-group">
                                <label class="col-sm-2 control-label no-padding-right" for="form-field-1"> 文章标题(EN)：  </label>
                                <div class="col-sm-10">
                                    <input type="text" name="news_enname" id="news_name" value="{$news.news_entitle}"  placeholder="必填：文章标题(EN)"  class="col-xs-10 col-sm-6"/>
                                    <span class="help-inline col-xs-12 col-sm-7">
                                        <span class="middle" id="resone"></span>
                                    </span>
                                </div>
                            </div>
                            <div class="space-4"></div>

                            <div class="form-group">
                                <label class="col-sm-2 control-label no-padding-right" for="form-field-1"> 是否审核： </label>
                                <div class="col-sm-10" style="padding-top:5px;">
                                    <input name="news_open" id="news_open" value="1" class="ace ace-switch ace-switch-4 btn-flat" <if condition="$news.news_open eq '1'"> checked</if> type="checkbox" />
                                    <span class="lbl">&nbsp;&nbsp;默认开启</span>
                                </div>
                            </div>
                            <div class="space-4"></div>


                            <div class="form-group">
                                <label class="col-sm-2 control-label no-padding-right" for="form-field-1"> 文章主内容 </label>
                                <div class="col-sm-10">
                                    <textarea  name="kind_text">{$news.news_content}</textarea>
                                </div>
                            </div>
                            <div class="space-4"></div>
                            <div class="form-group">
                                <label class="col-sm-2 control-label no-padding-right" for="form-field-1"> 文章主内容(EN) </label>
                                <div class="col-sm-10">
                                    <textarea  name="kind_text1">{$news.news_encontent}</textarea>
                                </div>
                            </div>
                            <div class="space-4"></div>

                            <div class="clearfix form-actions">
                                <div class="col-md-offset-3 col-md-9">
                                    <button class="btn btn-info" type="submit">
                                        <i class="ace-icon fa fa-check bigger-110"></i>
                                        保存
                                    </button>

                                    &nbsp; &nbsp; &nbsp;
                                    <button class="btn" type="reset">
                                        <i class="ace-icon fa fa-undo bigger-110"></i>
                                        重置
                                    </button>
                                </div>
                            </div>
                        </form>
                    </div>
                </div>
                <div class="hr hr-24"></div>

                <include file='Common:header_nav' />

            </div><!-- /.page-content -->
        </div>
    </div><!-- /.main-content -->

    <include file='Common:footer' />

</div><!-- /.main-container -->

<!--下拉样式以及JS-->
<link rel="stylesheet" href="__PUBLIC__/assets/css/chosen.css" />
<script src="__PUBLIC__/assets/js/chosen.jquery.js"></script>
<script type="text/javascript">
    jQuery(function ($) {
        if (!ace.vars['touch']) {
            $('.chosen-select').chosen({allow_single_deselect: true});
            $(window)
                    .off('resize.chosen')
                    .on('resize.chosen', function () {
                        $('.chosen-select').each(function () {
                            var $this = $(this);
                            $this.next().css({'width': $this.parent().width()});
                        })
                    }).trigger('resize.chosen');

        }
    });
</script>
</body>
</html>
<script>
    $(document).ready(function () {
        $("#pptaddress").hide();
        $("#news_flag_vaj").click(function () {
            $("#pptaddress").toggle(500);
        });
    });

    $(function () {
        $('#address').hide();//默认隐藏
        $('#type2').click(function () {
            $('#address').show();
        });
        $('#type1,#type3,#type4,#type5').click(function () {
            $('#address').hide();
        });
    });

    $(function () {
        $('#columnadd').ajaxForm({
            beforeSubmit: checkForm, // 此方法主要是提交前执行的方法，根据需要设置
            success: complete, // 这是提交后的方法
            dataType: 'json'
        });

        function checkForm() {
            if ('' == $.trim($('#news_name').val())) {
                $('#resone').attr("class", "middle highmsg");//ID为resone 重新class赋值
                $('#resone').html('栏目标题不能为空').show();//id为resone 赋值html值
                $('#news_name').focus();
                return false;
            }
        }
        function complete(data) {
            if (data.status == 1) {
                layer.alert(data.info, {icon: 6}, function (index) {
                    layer.close(index);
                    window.location.href = data.url;
                });
            } else {
                alert(data.info);
                return false;
            }
        }

    });
</script>
